<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var age = 19;               // 声明变量age并赋值为15
    if (age >= 18) {
      console.log('已成年');    // 在控制台输出“已成年”
    }

    var age = 15;               // 声明变量age
    if (age >= 18) {
      console.log('已成年');     // 当age >= 18时在控制台输出“已成年”
    } else {
      console.log('未成年');     // 当age < 18时在控制台输出“未成年”
    }

    var score = 58;
    if (score >= 90) {
      console.log('优秀');
    } else if (score >= 80) {
      console.log('良好');
    } else if (score >= 70) {
      console.log('中等');
    } else if (score >= 60) {
      console.log('及格');
    } 

    var week =8;
    switch (week) {
    case 0:
      console.log('星期日');
      break;
    case 1:
      console.log('星期一');
      break;
    case 2:
      console.log('星期二');
      break;
    case 3:
      console.log('星期三');
      break;
    case 4:
      console.log('星期四');
      break;
    case 5:
      console.log('星期五');
      break;
    case 6:
      console.log('星期六');
      break;
    default:
      console.log('错误');
    };

  </script>
</body>
</html>